/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.pay.accountsetting.view;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.FrameLayout.LayoutParams;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.ScrollView;
import android.widget.TextView;
import com.qihoo.gamecenter.sdk.common.d.a.a;
import com.qihoo.gamecenter.sdk.common.i.s;
import com.qihoo.gamecenter.sdk.pay.res.b;
import com.qihoo.stat.QHStatDo;
import java.util.ArrayList;
import java.util.Iterator;

public class BindBankContentView extends LinearLayout {
    private Activity a;
    private b b;
    private boolean c;
    private LinearLayout d;
    private com.qihoo.gamecenter.sdk.pay.k.a e;

    private BindBankContentView(Context paramContext) {
        super(paramContext);
    }

    public BindBankContentView(Activity paramActivity, Intent paramIntent) {
        this(paramActivity);
        this.a = paramActivity;
        this.b = b.a(this.mContext);
        this.c = paramIntent.getBooleanExtra("screen_orientation", true);
        b();
    }

    private void b() {
        int i = 0;
        int j = 0;
        if (this.c) {
            j = s.b(this.a, 15.0F);
            i = s.b(this.a, 80.0F);
        }
        else {
            j = i = s.b(this.a, 20.0F);
        }
        setOrientation(1);
        AccountNameView localAccountNameView = new AccountNameView(this.a);
        localAccountNameView.setLayoutParams(new LinearLayout.LayoutParams(-1, s.b(this.a, 40.0F)));
        localAccountNameView.setPadding(i, 0, 0, 0);
        addView(localAccountNameView);
        ScrollView localScrollView = new ScrollView(this.a);
        localScrollView.setLayoutParams(new LinearLayout.LayoutParams(-1, -1));
        addView(localScrollView);
        this.d = new LinearLayout(this.a);
        this.d.setPadding(i, j, i, j);
        this.d.setOrientation(1);
        this.d.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
        localScrollView.addView(this.d);
        QHStatDo.event("360sdk_account_manage_card_manage_click", null);
    }

    public void a() {
        this.d.removeAllViews();
        TextView localTextView = new TextView(this.a);
        localTextView.setTextSize(1, s.a(this.a, 14.7F));
        localTextView.setTextColor(-11776948);
        this.d.addView(localTextView);
        ArrayList localArrayList = com.qihoo.gamecenter.sdk.pay.g.a.d();
        if ((localArrayList != null) && (!(localArrayList.isEmpty()))) {
            localTextView.setText(com.qihoo.gamecenter.sdk.common.d.a.a(a.a.gU));
            View localView = null;
            LinearLayout.LayoutParams localLayoutParams = new LinearLayout.LayoutParams(-1, -2);
            localLayoutParams.topMargin = s.b(this.a, 15.0F);
            Iterator localIterator = localArrayList.iterator();
            while (localIterator.hasNext()) {
                com.qihoo.gamecenter.sdk.pay.e.a locala = (com.qihoo.gamecenter.sdk.pay.e.a) localIterator.next();
                localView = a(locala);
                this.d.addView(localView, localLayoutParams);
            }
        }
        else {
            localTextView.setText(com.qihoo.gamecenter.sdk.common.d.a.a(a.a.gV));
        }
    }

    public void setOnBtnClickListener(com.qihoo.gamecenter.sdk.pay.k.a parama) {
        this.e = parama;
    }

    private View a(com.qihoo.gamecenter.sdk.pay.e.a parama) {
        int i = s.b(this.a, 15.0F);
        RelativeLayout localRelativeLayout = new RelativeLayout(this.a);
        localRelativeLayout.setGravity(16);
        this.b.a(localRelativeLayout, -1073741729);
        localRelativeLayout.setPadding(i, i, i, i);
        localRelativeLayout.setOnClickListener(new View.OnClickListener(parama) {
            public void onClick(View paramView) {
                QHStatDo.event("360sdk_account_manage_binded_card_click", null);
                if (BindBankContentView.a(BindBankContentView.this) == null)
                    return;
                BindBankContentView.a(BindBankContentView.this).a(65302, paramView, new Object[] { this.a });
            }
        });
        RelativeLayout.LayoutParams localLayoutParams = new RelativeLayout.LayoutParams(-2, -2);
        localLayoutParams.addRule(9, -1);
        localLayoutParams.topMargin = s.b(this.a, 7.0F);
        LinearLayout localLinearLayout1 = new LinearLayout(this.a);
        localLinearLayout1.setLayoutParams(localLayoutParams);
        localLinearLayout1.setGravity(16);
        localLinearLayout1.setOrientation(1);
        this.b.a(localLinearLayout1, null, new ColorDrawable(7171437), null);
        localRelativeLayout.addView(localLinearLayout1);
        LinearLayout.LayoutParams localLayoutParams1 = new LinearLayout.LayoutParams(-2, -2);
        localLayoutParams1.bottomMargin = s.b(this.a, 10.0F);
        LinearLayout localLinearLayout2 = new LinearLayout(this.a);
        localLinearLayout2.setLayoutParams(localLayoutParams1);
        localLinearLayout2.setGravity(16);
        localLinearLayout2.setOrientation(0);
        localLinearLayout1.addView(localLinearLayout2);
        Object localObject = new ImageView(this.a);
        ((ImageView) localObject)
                .setLayoutParams(new LinearLayout.LayoutParams(s.b(this.a, 21.0F), s.b(this.a, 21.0F)));
        ((ImageView) localObject).setScaleType(ImageView.ScaleType.FIT_XY);
        ((ImageView) localObject).setImageDrawable(this.b.a(com.qihoo.gamecenter.sdk.pay.b.a.a(parama.i())));
        localLinearLayout2.addView((View) localObject);
        TextView localTextView = new TextView(this.a);
        localTextView.setSingleLine();
        localTextView.setPadding(s.b(this.a, 5.0F), 0, 0, 0);
        localTextView.setText(parama.h() + " " + parama.n());
        localTextView.setTextColor(-11776948);
        localTextView.setTextSize(1, s.a(this.a, 14.0F));
        localLinearLayout2.addView(localTextView);
        localObject = new TextView(this.a);
        ((TextView) localObject).setLayoutParams(new LinearLayout.LayoutParams(-2, -2));
        ((TextView) localObject).setText(String.format(com.qihoo.gamecenter.sdk.common.d.a.a(a.a.gT),
                new Object[] { parama.g() }));
        ((TextView) localObject).setTextColor(-11776948);
        ((TextView) localObject).setTextSize(1, s.a(this.a, 14.0F));
        ((TextView) localObject).setSingleLine();
        localLinearLayout1.addView((View) localObject);
        return ((View) localRelativeLayout);
    }
}